package com.aixingfu.sports.Adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.List;

/**
 *  @ 作者
 *  @ 创建时间 2018\9\12 0012
 *  @ 说明 Fragment切换适配器
 */

public class MyFragmentAdapter extends FragmentPagerAdapter {
    private List<Fragment> fragmentList;
    private String[] titles;
    public MyFragmentAdapter(FragmentManager fm, List<Fragment> listFragment, String[] titles) {
        super(fm);
        fragmentList=listFragment;
        this.titles=titles;
    }

    @Override
    public Fragment getItem(int position) {
        return fragmentList.get(position);
    }

    @Override
    public int getCount() {
        return fragmentList.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return titles[position];
    }


}
